package com.shuai.api_platform.controller;

import com.shuai.api_platform.common.BaseResponse;
import com.shuai.api_platform.model.TestVO;
import com.shuai.api_platform.utils.ResultUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/test")
@RestController
public class TestController {

    @RequestMapping(value = "/name", method = RequestMethod.POST)
    public BaseResponse<TestVO> test(@RequestBody TestVO testVO) {
        if (testVO.getParamTest() == null) {
            testVO.setParamTest("null");
        }
        if (testVO.getTest() == null) {
            testVO.setTest("null");
        }
        return ResultUtils.success(testVO);
    }
}
